module if_stmt;
    int a, b, c;
    
    initial begin
        // unique-if: 条件互斥 有且仅有一个条件为真
        // unique-if 通常综合为[多路选择器 (Mux)]
        begin: unique_if
            $display("unique-if example:");

            a = 10; b = 20; c = 40;
            // VSC: Warning-[RT-MTOCMUIF] More than one condition match in statement
            // 当使用 unique if 时, 如果有多个条件匹配, 会产生编译警告或仿真错误
            unique if ( a < b ) $display("\t a is less than b");
            else   if ( a < c ) $display("\t a is less than c");
            else                $display("\t a is greater than b and c");

            a = 50; b = 20; c = 40;
            // VSC: Warning-[RT-NCMUIF] No condition matches in statement
            // 当使用 unique if 时, 如果没有条件匹配, 会产生编译警告或仿真错误
            unique if ( a < b ) $display("\t a is less than b");
            else   if ( a < c ) $display("\t a is less than c");

            a = 50; b = 20; c = 40;
            unique if ( a < b ) $display("\t a is less than b");
            else   if ( a < c ) $display("\t a is less than c");
            else                $display("\t a is greater than b and c");
        end

        // priority-if: 条件按顺序检查, 第一个为 true 的分支生效
        // priority-if 通常综合为[优先级编码器 (Priority Encoder)]
        begin: priority_if
            $display("priority-if example:");

            a = 10; b = 20; c = 40;
            priority if ( a < b ) $display("\t a is less than b");
            else     if ( a < c ) $display("\t a is less than c");
            else                  $display("\t a is greater than b and c");

            a = 50; b = 20; c = 40;
            // VSC: Warning-[RT-MTOCMUIF] More than one condition match in statement
            // 当使用 priority if 时, 如果没有条件匹配, 会产生编译警告或仿真错误
            priority if ( a < b ) $display("\t a is less than b");
            else     if ( a < c ) $display("\t a is less than c");
        end
    end
endmodule